/*
 * @Author: 高瑞寒 15932717091@163.com
 * @Date: 2022-05-07 00:33:19
 * @LastEditTime: 2022-05-07 00:39:00
 * @LastEditors: 高瑞寒 15932717091@163.com
 * @Description: 
 */
import React, { Component } from 'react'

export default class Parent extends Component{
  render() {
    return (
      <div>
        <A render={(count) => <B  count={count}/>} />
      </div>
    )
  }
}
 class A extends Component {
   state = {
     count:0
   }
  render() {
    return (
      <div>
        {this.props.render(this.state.count)}
      </div>
    )
  }
}
class B extends Component {
  render() {
    return (
      <div>{this.props.count}</div>
    )
  }
}

